package com.zlm.tools.validation;

import org.quartz.xml.ValidationException;

/**
 * {@code }
 *
 * @author zlm
 * @since 2025/5/30
 */
public class MinValidatorHandler  implements ValidatorHandler{

    private final Integer min;
    public MinValidatorHandler(Integer min) {
        this.min = min;
    }

    @Override
    public void validate(String filed,Object value, ValidatorContext context) {
        if(value instanceof Integer){
            Integer intValue = (Integer) value;
            if(intValue < min){
                context.addError(filed + "值不能小于" + min);
            }
        }
    }
}
